<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>系统简介</title>
    <link rel="shortcut icon" href="/img/favicon.ico" /><!--标签页面顶部的小图标-->
    <script th:src="@{/webjars/jquery/3.3.1/jquery.js}"></script>
    <link th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}" rel="stylesheet"/>
    <script th:src="@{/webjars/bootstrap/4.0.0/js/bootstrap.js}"></script>
    <script>

        function findSystem(){
            $.ajax({
                url:"/admin/findSystem.do",
                type:"get",
                success:function (result) {
                    $("#text").val(result.guanYuWoMen);
                },
                error:function () {
                    alert("系统异常");
                }
            })
        }

        $(function () {
            findSystem();
        })

        function updateSystem() {
            $.ajax({
                url:"/admin/updateSystem.do",
                type:"get",
                data:{guanYuWoMen:$("#text").val()},
                success:function(result){
                    alert("修改成功！");
                },
                error:function () {
                    alert("系统异常");
                }
            })
        }

        function reset() {
            $("#text").val("");
        }

    </script>
</head>

</head>
<body>
    <div id="allText" style="margin-left: 10px;margin-top: 30px">

        <table class='table table-hover' border='1' bordercolor='green'>
            <tr><td colspan='2'>修改关于我们</td></tr>
            <tr>
                <td>内容:</td>
                <td><textarea cols='60' rows='5' name='guanYuWoMen' id='text'></textarea></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    &nbsp;&nbsp;<button class='btn btn-primary btn-sm' onclick="reset();">清空</button>&nbsp;&nbsp;
                    <button class='btn btn-primary btn-sm' onclick="findSystem();">还原</button>&nbsp;&nbsp;
                    <button class='btn btn-primary btn-sm' onclick='updateSystem();'>提交</button>
                </td>
            </tr>
        </table>

    </div>
</body>
</html>